import request from "@/api/request"
import type { AxiosResponse } from "axios"

// get
export type GetVersionParams = {
  channel: string | number,
  page: number,
  page_size: number
}
export function getVersion(params: GetVersionParams):Promise<AxiosResponse>{
  return request('version/query_versions', params, 'post')
}

// create
export type CreateVersionParams = FormData
export function createVersion(params: CreateVersionParams):Promise<AxiosResponse>{
  return request('version/create_version', params, 'post')
}

// update
export type UpdateVersionParams = FormData
export function updateVersion(params: UpdateVersionParams):Promise<AxiosResponse>{
  return request('version/update_version', params, 'post')
}

// delete
export type DeleteVersionParams = {
  version_id: number | string
}
export function deleteVersion(params:DeleteVersionParams):Promise<AxiosResponse>{
  return request('version/delete_version', params, 'post')
}